<!doctype html>
<html class="no-js" lang="">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; connect-src *; img-src * data: https:; media-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'">
  <title>Puppetry Suite Recorder</title>
  <meta
    name="viewport"
    content="width=device-width, initial-scale=1, user-scalable=0, maximum-scale=1, minimum-scale=1"
  >
  <link rel="shortcut icon" href="./assets/favicon.ico" type="image/x-icon">
  <link rel="icon" href="./assetsfavicon.ico" type="image/x-icon">
  <link rel="icon" type="image/png" sizes="32x32" href="./assets/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="./assets/favicon-96x96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="./assets/favicon-16x16.png">
  <script src="./vendor/smalltalk/smalltalk.min.js"></script>

  <style>

    * {
        box-sizing: border-box;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    @keyframes pulse {
      0% {
        opacity: 1;
      }
      50% {
        opacity: 0;
      }
    }

    .is-disabled {
      opacity: .6;
      pointer-events: none;
    }

    .icon {
      display: inline-block;
    }

    .is-hidden {
      display: none !important;
    }

    body {
      background: #f0f2f5;
      margin: 0;
      padding: 0;
      font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    }
    svg {
      fill: currentColor;
    }

    .toolbar {
      height: 40px;
      display: flex;
      align-items: center;
      padding: 0 8px;
      color: #314659;
    }
    .toolbar__url {
      font-size: 16px;
      line-height: 32px;
      height: 32px;
      border-radius: 4px;
      background: white;
      border: 1px solid #555;
      padding: 4px 8px;
      width: 100%;
      color: #314659;
    }
    .toolbar__url:focus {
      border: 1px solid #0069d9;
      outline: none;
    }

    .select-placeholder {
      color: #999;
    }

    .select {
      font-size: 16px;
      line-height: 22px;
      height: 24px;

      background: white;
      border: 1px solid #555;
      padding: 0 4px;
      border-radius: 4px;
      margin-left: 8px;
    }

    .toolbar__select {
      font-size: 16px;
      line-height: 30px;
      height: 32px;
      width: 125px;
      background: white;
      border: 1px solid #555;
      padding: 0 4px;
      border-radius: 4px;
      margin-left: 8px;
    }

    .toolbar__select:focus {
      border: 1px solid #0069d9;
      outline: none;
    }

    .toolbar__item {
      margin-left: 8px;
      color: #555;
    }

    .toolbar__item:visited, .toolbar__item:active {
      color: #555;
    }

    .toolbar__item.icon {
      width: 24px;
      height: 24px;
      transition: transform .3s ease-in-out;
    }

    toolbar__item.icon.is-disabled {
      opacity: .5;
      cursor: default;
      pointer-events: none;
    }

    .toolbar__item.icon:hover {
      transform: scale(1.2);
    }

    .toolbar__item.icon svg {
      width: 24px;
      height: 24px;
    }

    .icon--recording {
      animation: pulse 2s infinite;
    }

    webview {
      width: 100%;
      /* 40px + 24px of log */
      height: calc(100vh - 68px);
    }

    .info {
      box-sizing: border-box;
      font-size: 16px;
      line-height: 22px;
      color: rgba(0, 0, 0, 0.65);
      position: relative;
      height: calc(100vh - 40px);
      background-color: #fff;
      border: 0;
      padding: 32px;
    }


    .info .icon svg {
      width: 16px;
      height: 16px;
    }

    .info a, .info a:visited, .info a:active {
      color: #555;
    }

    .info ul {
      padding-left: 16px;
      margin: 0;
      list-style-type: square;
    }

    .info ul li {
      line-height: 26px;
    }

    .info h1 {
      font-size: 20px;
      line-height: 24px;
      margin: 0 0 24px 0;
    }
    .info h2 {
      font-size: 16px;
      line-height: 18px;
      margin: 16px 0;
    }
    .info p {
      margin: 0;
    }
    .info p + p {
      margin-top: 8px;
    }

    kbd {
      background-color: #eee;
      border-radius: 3px;
      border: 1px solid #b4b4b4;
      box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 2px 0 0 rgba(255,255,255,.7) inset;
      color: #333;
      display: inline-block;
      font-family: consolas,"Liberation Mono",courier,monospace;
      font-size: .85em;
      font-weight: 700;
      line-height: 1;
      padding: 2px 4px;
      white-space: nowrap;
  }

  .btn {
    line-height: 1.499;
    position: relative;
    display: inline-block;
    font-weight: 400;
    white-space: nowrap;
    text-align: center;
    background-image: none;
    border: 1px solid transparent;
    -webkit-box-shadow: 0 2px 0 rgba(0,0,0,0.015);
    box-shadow: 0 2px 0 rgba(0,0,0,0.015);
    cursor: pointer;
    -webkit-transition: all .3s cubic-bezier(.645, .045, .355, 1);
    transition: all .3s cubic-bezier(.645, .045, .355, 1);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    height: 32px;
    padding: 0 15px;
    font-size: 14px;
    border-radius: 4px;
    color: #fff;
    background-color: #1890ff;
    border-color: #1890ff;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.12);
    -webkit-box-shadow: 0 2px 0 rgba(0,0,0,0.045);
    box-shadow: 0 2px 0 rgba(0,0,0,0.045);

  }

  .btn:hover {
    text-decoration: none;
    color: #fff;
    background-color: #40a9ff;
    border-color: #40a9ff;
  }

  .btn:disabled {
    color: rgba(0,0,0,0.25);
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    text-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: none;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-40px);
    }

    to {
      transform: translateY(0px);
    }
  }

  .notify {
    position: fixed;
    top: 0;
    width: 200px;
    left: 50%;
    transform: translateX(-100px) translateY(-40px);
    padding: 8px;
    margin: 8px;
    z-index: 99999;
    border: 1px solid #CCC;
    background: #EEE;
    border-radius: 4px;
    display: none;
    text-align: center;
   /* box-shadow: 4px 4px 3px rgba(0,0,0, 50%); */
  }

  .has-go {
    display: block;
    animation: slideDown 500ms forwards;
  }

  .log {
    height: 24px;
    margin: 0 8px 4px 8px;
    width: calc(100% - 16px);
    position: relative;
  }

  .log__content {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    line-height: 24px;
    padding: 0 4px;
    font-size: 12px;
    background: #EEE;
    border: 1px solid #CCC;
    color: #444;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    white-space: pre;
    z-index: 99999;
  }

  .log__content:hover {
    height: 124px;
  }

  .log i {
    font-style: normal;
    color: #a67f59;
  }
  .log b {
    font-weight: normal;
    color: #1890ff;
  }


  </style>
</head>

<body>

  <div class="notify" id="notify" >Screenshot saved</div>
  <div class="toolbar">
    <input id="url"
           type="url"
           class="toolbar__url"
           placeholder="Enter URL and press Enter" />

    <a href="#" id="loadUrl" class="toolbar__item icon" title="Load URL">
      <svg viewBox="64 64 896 896" focusable="false" class="" data-icon="right-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M666.7 505.5l-246-178A8 8 0 0 0 408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z"></path><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path></svg>
    </a>

    <select id="select" class="toolbar__select is-hidden">
      <option class="select-placeholder">Select device</option>
      <option value="default">Apple MacBook Air 11-inch (1366x768)</option>
    </select>
    <a href="#" id="devtools" class="toolbar__item icon is-disabled" title="Open DevTools">
      <svg viewBox="64 64 896 896" focusable="false" class="" data-icon="tool" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 0 1 144-53.5L537 318.9a32.05 32.05 0 0 0 0 45.3l124.5 124.5a32.05 32.05 0 0 0 45.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"></path></svg>
    </a>

    <button id="okBtn" disabled class="toolbar__item btn">Create Suite</button>


  </div>
  <div class="log is-hidden">
    <div class="log__content" id="log"></div>
  </div>
  <webview class="is-hidden" partition="persist:recorder" disablewebsecurity nodeintegration allowpopups preload="./recorder/webview/index.js"></webview>

  <div id="info" class="info">

  <h1>Welcome to Puppetry Recorder</h1>
  <p>
    Puppetry Recorder we use to record user interactions on the target web pages as a test suite.
    To start you need to type in the toolbar the URL of a page and press Enter.
    As pages loaded you can interact with them (click elements, type in inputs, resize window, scroll,
    navigate pages  and so on).
  </p>
  <p>
    Note: Puppetry recorder does not follow popup windows yet
  </p>


  <h2>Available tools</h2>
  <ul>
    <li>
      <b>Address bar</b> - navigate to the provided URL
    </li>
    <li>
      <b>Select device</b> combobox - resize window to match the selected device screen
    </li>
    <li>
      <b>Create Suite</b> button - save recording as a test suite and return to Puppetry main window
    </li>
    <li>
      On the page:
      <ul>
        <li>
        <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>S</kbd> - add "make a screenshot" command to the log. Can be used to mark a particular step in your session
      </li>
      <li>
        <b>Right-click</b> (or <kbd>Ctrl</kbd> <kbd>Shift</kbd> <b>Left-click</b>) - register a hovered element as a target
      </li>
      </ul>
    </li>
  </ul>
  <br />
  <p>When moving mouse cursor on a loaded page the hovered elements are being highlighted.
    <br />Here you can pick an outline color most suiting to your test page design:
    <select id="color" class="select">
      <option value="#f0f8ff">aliceblue</option>
<option value="#faebd7">antiquewhite</option>
<option value="#00ffff">aqua</option>
<option value="#7fffd4">aquamarine</option>
<option value="#f0ffff">azure</option>
<option value="#f5f5dc">beige</option>
<option value="#ffe4c4">bisque</option>
<option value="#000000">black</option>
<option value="#ffebcd">blanchedalmond</option>
<option selected value="#0000ff">blue</option>
<option value="#8a2be2">blueviolet</option>
<option value="#a52a2a">brown</option>
<option value="#deb887">burlywood</option>
<option value="#5f9ea0">cadetblue</option>
<option value="#7fff00">chartreuse</option>
<option value="#d2691e">chocolate</option>
<option value="#ff7f50">coral</option>
<option value="#6495ed">cornflowerblue</option>
<option value="#fff8dc">cornsilk</option>
<option value="#dc143c">crimson</option>
<option value="#00ffff">cyan</option>
<option value="#00008b">darkblue</option>
<option value="#008b8b">darkcyan</option>
<option value="#b8860b">darkgoldenrod</option>
<option value="#a9a9a9">darkgray</option>
<option value="#006400">darkgreen</option>
<option value="#a9a9a9">darkgrey</option>
<option value="#bdb76b">darkkhaki</option>
<option value="#8b008b">darkmagenta</option>
<option value="#556b2f">darkolivegreen</option>
<option value="#ff8c00">darkorange</option>
<option value="#9932cc">darkorchid</option>
<option value="#8b0000">darkred</option>
<option value="#e9967a">darksalmon</option>
<option value="#8fbc8f">darkseagreen</option>
<option value="#483d8b">darkslateblue</option>
<option value="#2f4f4f">darkslategray</option>
<option value="#2f4f4f">darkslategrey</option>
<option value="#00ced1">darkturquoise</option>
<option value="#9400d3">darkviolet</option>
<option value="#ff1493">deeppink</option>
<option value="#00bfff">deepskyblue</option>
<option value="#696969">dimgray</option>
<option value="#696969">dimgrey</option>
<option value="#1e90ff">dodgerblue</option>
<option value="#b22222">firebrick</option>
<option value="#fffaf0">floralwhite</option>
<option value="#228b22">forestgreen</option>
<option value="#ff00ff">fuchsia</option>
<option value="#dcdcdc">gainsboro</option>
<option value="#f8f8ff">ghostwhite</option>
<option value="#daa520">goldenrod</option>
<option value="#ffd700">gold</option>
<option value="#808080">gray</option>
<option value="#008000">green</option>
<option value="#adff2f">greenyellow</option>
<option value="#808080">grey</option>
<option value="#f0fff0">honeydew</option>
<option value="#ff69b4">hotpink</option>
<option value="#cd5c5c">indianred</option>
<option value="#4b0082">indigo</option>
<option value="#fffff0">ivory</option>
<option value="#f0e68c">khaki</option>
<option value="#fff0f5">lavenderblush</option>
<option value="#e6e6fa">lavender</option>
<option value="#7cfc00">lawngreen</option>
<option value="#fffacd">lemonchiffon</option>
<option value="#add8e6">lightblue</option>
<option value="#f08080">lightcoral</option>
<option value="#e0ffff">lightcyan</option>
<option value="#fafad2">lightgoldenrodyellow</option>
<option value="#d3d3d3">lightgray</option>
<option value="#90ee90">lightgreen</option>
<option value="#d3d3d3">lightgrey</option>
<option value="#ffb6c1">lightpink</option>
<option value="#ffa07a">lightsalmon</option>
<option value="#20b2aa">lightseagreen</option>
<option value="#87cefa">lightskyblue</option>
<option value="#778899">lightslategray</option>
<option value="#778899">lightslategrey</option>
<option value="#b0c4de">lightsteelblue</option>
<option value="#ffffe0">lightyellow</option>
<option value="#00ff00">lime</option>
<option value="#32cd32">limegreen</option>
<option value="#faf0e6">linen</option>
<option value="#ff00ff">magenta</option>
<option value="#800000">maroon</option>
<option value="#66cdaa">mediumaquamarine</option>
<option value="#0000cd">mediumblue</option>
<option value="#ba55d3">mediumorchid</option>
<option value="#9370db">mediumpurple</option>
<option value="#3cb371">mediumseagreen</option>
<option value="#7b68ee">mediumslateblue</option>
<option value="#00fa9a">mediumspringgreen</option>
<option value="#48d1cc">mediumturquoise</option>
<option value="#c71585">mediumvioletred</option>
<option value="#191970">midnightblue</option>
<option value="#f5fffa">mintcream</option>
<option value="#ffe4e1">mistyrose</option>
<option value="#ffe4b5">moccasin</option>
<option value="#ffdead">navajowhite</option>
<option value="#000080">navy</option>
<option value="#fdf5e6">oldlace</option>
<option value="#808000">olive</option>
<option value="#6b8e23">olivedrab</option>
<option value="#ffa500">orange</option>
<option value="#ff4500">orangered</option>
<option value="#da70d6">orchid</option>
<option value="#eee8aa">palegoldenrod</option>
<option value="#98fb98">palegreen</option>
<option value="#afeeee">paleturquoise</option>
<option value="#db7093">palevioletred</option>
<option value="#ffefd5">papayawhip</option>
<option value="#ffdab9">peachpuff</option>
<option value="#cd853f">peru</option>
<option value="#ffc0cb">pink</option>
<option value="#dda0dd">plum</option>
<option value="#b0e0e6">powderblue</option>
<option value="#800080">purple</option>
<option value="#663399">rebeccapurple</option>
<option value="#ff0000">red</option>
<option value="#bc8f8f">rosybrown</option>
<option value="#4169e1">royalblue</option>
<option value="#8b4513">saddlebrown</option>
<option value="#fa8072">salmon</option>
<option value="#f4a460">sandybrown</option>
<option value="#2e8b57">seagreen</option>
<option value="#fff5ee">seashell</option>
<option value="#a0522d">sienna</option>
<option value="#c0c0c0">silver</option>
<option value="#87ceeb">skyblue</option>
<option value="#6a5acd">slateblue</option>
<option value="#708090">slategray</option>
<option value="#708090">slategrey</option>
<option value="#fffafa">snow</option>
<option value="#00ff7f">springgreen</option>
<option value="#4682b4">steelblue</option>
<option value="#d2b48c">tan</option>
<option value="#008080">teal</option>
<option value="#d8bfd8">thistle</option>
<option value="#ff6347">tomato</option>
<option value="#40e0d0">turquoise</option>
<option value="#ee82ee">violet</option>
<option value="#f5deb3">wheat</option>
<option value="#ffffff">white</option>
<option value="#f5f5f5">whitesmoke</option>
<option value="#ffff00">yellow</option>
<option value="#9acd32">yellowgreen</option>
    </select>
  </p>
  <br /><br />
  <p>If you experience any problems with application, please, report to
          <a id="report"
            href="https://github.com/dsheiko/puppetry/issues"
            rel="noopener noreferrer">github.com/dsheiko/puppetry/issues</a></p>

  </div>

  <script src="./recorder/renderer.js"></script>

</body>

</html>